using System.Collections.Generic;
using cfg.level;
using UnityEngine;
using QFramework;

namespace QFramework.Monk
{
	public partial class SimpleBall : AbilityBase
	{
		private List<Ball> mBalls = new List<Ball>();
		public override void InitAbility()
		{
			mCount = 1;
			//mLevel = 0;
			mSpeed = 15;
			//CreateBall();
			//base.ShowAbility();
			Ball.Hide();
		}

		private void CreateBall()
		{
			var ball = Ball.InstantiateWithParent(this.transform).WithOwner(this).Show().LocalScale(mIsSuper? 2:1);
			mBalls.Add(ball);
		}

		protected override void OnSkillChange()
		{
			foreach (var mBall in mBalls)
			{
				mBall.LocalScale(2);
			}
		}

		protected override void OnCountAdd()
		{
			CreateBall();
		}

		public override void UnLockAbility(bool isForce = false)
		{
			base.UnLockAbility(isForce);
			CreateBall();
		}
	}
}
